﻿@model ScmSafetyknowledgeViewModel
@{
    Layout = null;
    ViewBag.Title = "安全知识列表";
}

<div class="page" style="border-top: 1px solid #b8d0d6;" layouth="1">
    @*@using (Html.BeginForm("SplitPage", "ScmSafeTraining", null, FormMethod.Post, new { id = "pagerForm" }))
    {
        <input type="hidden" name="pageNum" value="1" />
        <input type="hidden" name="numPerPage" value="@(ViewBag.numPerPage)" />
        <input type="hidden" name="pageType" value="@(ViewBag.type)" />
        @Html.Hidden("TheSafetyKnowledge.Sk_Title", Model.TheSafetyKnowledge == null ? "" : Model.TheSafetyKnowledge.Sk_Title)    
        @Html.Hidden("TheSafetyKnowledge.Sk_PublishOrgName", Model.TheSafetyKnowledge == null ? "" : Model.TheSafetyKnowledge.Sk_PublishOrgName)
        @Html.Hidden("PublishBeginTime", Model.PublishBeginTime)
        @Html.Hidden("PublishEndTime", Model.PublishEndTime)
    }*@
    @using (Html.BeginForm("SafeTrainningList2", "ScmSafeTraining", null, FormMethod.Post, new { id = "pagerForm", onsubmit = "return navTabSearch(this);" }))
    {
        <input type="hidden" name="pageNum" value="1" />
        <input type="hidden" name="numPerPage" value="@(ViewBag.numPerPage)" />
        <input type="hidden" name="pageType" value="@(ViewBag.type)" />
        <ul class="searchBar">
            <li id="li_train_@(ViewBag.type)"><span>@(ViewBag.typeName)：</span>
                @Html.TextBoxFor(model => model.TheSafetyKnowledge.Sk_Title)
            </li>
            <li><span>发布机构：</span>
                @Html.TextBoxFor(model => model.TheSafetyKnowledge.Sk_PublishOrgName)
            </li>
            <li><span>发布日期：</span>
                @Html.TextBoxFor(model => model.PublishBeginTime, new { @class = "date" })
                <span>-</span>
                @Html.TextBoxFor(model => model.PublishEndTime, new { @class = "date" })
            </li>
            <li>
                <button type="submit" class="btn btn-success btn-xs">
                    搜索</button>
            </li>
        </ul>
    }
    <div class="panelBar" style="border-top: none;">
        <ul class="toolBar">
            <li>
                @Html.PermissionButton("SafetyConstruction.ScmSafeTraining.Create2", "SafetyConstruction_ScmSafeTraining_SafeTrainningAdd1",
                    Url.Action("SafeTrainningAdd", "ScmSafeTraining", new { type = ViewBag.type, target = "add" }),
                    "添加",
                    new Dictionary<string, object>
                    {
                        {"class","add"},{"rel","zsk_add"} ,{"mask","true"},{"target","dialog"},{"width","640"},{"height","560"}
                    })
            </li>
            <li>
                @Html.PermissionButton("SafetyConstruction.ScmSafeTraining.Delete2", "SafetyConstruction_ScmSafeTraining_SafeTrainningMultiDelete1",
                    Url.Action("SafeTrainningMultiDelete", "ScmSafeTraining", new { type = ViewBag.type, ids = "{tr_id}" }),
                    "删除",
                    new Dictionary<string, object>
                    {
                        {"class","delete"},{"rel","ids"} ,{"title","确定要删除这些记录吗?"},{"target","ajaxTodo"},{"postType","string"}
                    })
            </li>
            <li>
                @Html.PermissionButton("SafetyConstruction.ScmSafeTraining.Create2", "SafetyConstruction_ScmSafeTraining_SafeTrainningAdd1",
                    Url.Action("SafeTrainningAdd", "ScmSafeTraining", new { type = ViewBag.type, target = "edit", skId = "{tr_id}" }),
                    "修改",
                    new Dictionary<string, object>
                    {
                        {"class","edit"},{"rel","zsk_edit"} ,{"mask","true"},{"target","dialog"},{"width","640"},{"height","560"},{"warn","请选择一条信息!"}
                    })
            </li>
            <li>
                @Html.PermissionButton("SafetyConstruction.ScmSafeTraining.Detail2", "SafetyConstruction_ScmSafeTraining_Detail1",
                    Url.Action("Detail", "ScmSafeTraining", new { type = ViewBag.type, id = "{tr_id}" }),
                    "查看",
                    new Dictionary<string, object>
                    {
                        {"class","detail"},{"rel","zsk_detail"} ,{"mask","true"},{"target","dialog"},{"width","640"},{"height","560"},{"warn","请选择一条信息!"}
                    })
            </li>
            @*<li><a class="delete" href="@Url.Action("SafeTrainningMultiDelete", "ScmSafeTraining", new { ids = "{tr_id}" })"  title="确定要删除该条记录吗?" target="ajaxTodo" ><span>删除</span></a></li>*@
        </ul>
    </div>
    <table class="table" width="100%" layouth="122">
        <thead>
            <tr>
                <th width="22" style="display:none">
                    <input type="checkbox" group="ids" class="checkboxCtrl">
                </th>
                <th width="50" style="text-align: center">
                    序号
                </th>
                <th style="text-align: center">@(ViewBag.typeName)
                </th>
                <th style="text-align: center">
                    发布机构
                </th>
                <th style="text-align: center">
                    发布日期
                </th>
            </tr>
        </thead>
        <tbody>
            @{ int num = (ViewBag.pageNum - 1) * ViewBag.numPerPage;}
            @foreach (var item in Model.TheSafetyKnowledgeList)
            {
                num += 1;
                <tr style="text-align:center" target="tr_id" rel="@item.Sk_ID">
                    <td style="text-align: center;display:none">
                        <input name="ids" value="@item.Sk_ID" type="checkbox">
                    </td>
                    <td style="text-align: center">@num
                    </td>
                    <td style="text-align: center">
                        <a title="查看@(ViewBag.typeName)" href="@Url.Action("Detail", "ScmSafeTraining", new { id = item.Sk_ID, type = ViewBag.type })" mask="true" target="dialog" width="820" height="610">@item.Sk_Title</a>
                    </td>
                    <td style="text-align: center">@item.Sk_PublishOrgName
                    </td>
                    <td style="text-align: center">@item.Sk_CreateTime.ToString("yyyy-MM-dd")
                    </td>
                </tr>
                  
            }
        </tbody>
    </table>
    <div class="panelBar" style="border-bottom: none;">
        <div class="pagination"  style="margin:0px;float:left; margin-left:35%" targettype="navTab" totalcount="@(ViewBag.totalcount)" numperpage="@(ViewBag.numPerPage)" pagenumshown="10" currentpage="@(ViewBag.pageNum)">
        </div>
        <div class="pages" style="float: right">
            <span>显示</span>
            <select class="comsplitpage" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
               <option value="10" @(ViewBag.numPerPage == 10 ? "selected='selected'" : "")>10</option>
                <option value="20" @(ViewBag.numPerPage == 20 ? "selected='selected'" : "")>20</option>
                <option value="50" @(ViewBag.numPerPage == 50 ? "selected='selected'" : "")>50</option>
            </select>
            <span>条，共@(ViewBag.pagenumshown)页,@(ViewBag.totalcount)条</span>
        </div>
    </div>
</div>
